package com.hncj.yqfk.ldao;

import com.hncj.yqfk.entity.LY;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

public interface LY_Dao extends JpaRepository<LY,Integer> {
    //    返回所有
    @Query(value = "SELECT * FROM ly_1",nativeQuery = true)
    List<LY> findAll();

    //    返回的所有的楼宇名称和楼宇编号
    @Query(value = "SELECT LYMC,LYBH FROM ly_1 WHERE LYZT=1",nativeQuery = true)
    List<Map<String,Object>> findAllInfo();

    //    根据场所ID返回楼宇名和经纬度
    @Query(value = "SELECT * FROM ly_1 WHERE LYMC = :LYMC ",nativeQuery = true)
    LY findInfoByMc(@Param("LYMC") String LYMC);
}
